#ifndef MAILER_H_
#define MAILER_H_

#include "../messages/Message.h"
#include "../headers/Worker.h"
#include "../headers/Mailbox.h"
#include <vector>
#include "../headers/OSScheduler.h"

using namespace std;

class Mailer : public Mailbox{

private:
	vector<Worker*> workers;
	OSScheduler* scheduler;

	void waitForSteadyState();

public:
	void run();

	Mailer(int buffer);
	void addNode(int node, vector<int>* neighbors);
	bool killNode(int id);
	bool reviveNode(int id);
	bool killAll();
	void printRT(int id);
	bool sendPacket(int sourceId, int targetId, string msg);
	bool start(int scheduleNum, int args);
	bool inSteadyState();
	virtual ~Mailer();
	void printCounters();

};

std::ostream& operator<< ( std::ostream&, const Mailer&);

#endif /*MAILER_H_*/
